<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="java.io.*" %>
<%@page import="java.util.*" %>
<%@page import="javax.servlet.*" %>
<%@page import="javax.servlet.http.*" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
    <h1>JSP Page</h1>
    <pre>
        <code>
    <%
        BufferedInputStream is = new BufferedInputStream(request.getInputStream());
        int bytesRead = 0;
        byte[] buffer = new byte[1024];

        while ((bytesRead = is.read(buffer)) != -1) {
            String chunk = new String(buffer, 0, bytesRead);
            System.out.print(chunk);
        }
        out.println();

        Enumeration<String> enu = request.getParameterNames();
        while(enu.hasMoreElements()) {
            String key = enu.nextElement();
            String value = request.getParameter(key);
            out.println(key+":"+value);
        }
        out.println();
        
        Enumeration enu1 = request.getHeaderNames();
        while(enu.hasMoreElements()) {
            String key = (String) enu1.nextElement();
            String value = request.getHeader(key);
            out.println(key+":"+value);
        }
    %>
        </code>
    </pre>
    
    </body>
</html>
